package com.zynn.feign.module.es;

import com.zynn.common.pojo.dto.zuul.LogInfoDTO;
import com.zynn.common.pojo.result.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author jerry-liqi
 * <p>
 * 用户奖励Service
 */
@FeignClient(value = "service-module-es")
public interface SyncEventFeignService {


    /**
     * 创建动态照片
     *
     * @param eventId
     * @param eventType
     * @param userId
     * @param groupId
     * @param accessGroupIds
     * @param groupTypeValue
     * @param location
     * @param title
     * @param content
     * @param publishTime
     * @param commentCount
     * @param likeCount
     * @return
     */
    @RequestMapping(value = "/sync/event/createOrUpdate", method = RequestMethod.POST)
    Result syncEvent(@RequestParam("eventId") Long eventId, @RequestParam("eventType") Integer eventType, @RequestParam("userId") Long userId, @RequestParam("groupId") Long groupId, @RequestParam(name = "accessGroupIds", required = false) String accessGroupIds, @RequestParam("groupTypeValue") Integer groupTypeValue, @RequestParam(name = "location", required = false) String location, @RequestParam("title") String title, @RequestParam("content") String content, @RequestParam("publishTime") String publishTime, @RequestParam("commentCount") Integer commentCount, @RequestParam("likeCount") Integer likeCount);


    /**
     * 删除动态
     *
     * @param eventId
     * @return
     */
    @RequestMapping(value = "/sync/event/remove", method = RequestMethod.POST)
    Result synRemoveEvent(@RequestParam("eventId") Long eventId);


    /**
     * 更新动态
     *
     * @param eventId
     * @param commentCount
     * @param likeCount
     * @return
     */
    @RequestMapping(value = "/sync/event/update", method = RequestMethod.POST)
    Result synUpdateEvent(@RequestParam("eventId") Long eventId, @RequestParam("commentCount") Integer commentCount, @RequestParam("likeCount") Integer likeCount);

    /**
     * 用户信息写入es
     *
     * @param userId
     * @param nickName
     * @param sex
     * @param headPic
     * @return
     */
    @RequestMapping(value = "/sync/user/createOrUpdate", method = RequestMethod.POST)
    Result syncUser(@RequestParam("userId") Long userId, @RequestParam("nickName") String nickName, @RequestParam("sex") int sex, @RequestParam("headPic") String headPic);

    /**
     * 将请求日志写入es
     *
     * @param logInfoDTO
     * @return
     */
    @RequestMapping(value = "/sync/log/create", method = RequestMethod.POST)
    Result syncLog(@RequestBody LogInfoDTO logInfoDTO);

    /**
     * 计算一个用户的一度好友
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/init/data/friend/one", method = RequestMethod.POST)
    Result initFriend(@RequestParam("userId") Long userId);

    /**
     * 计算一个用户的一度好友新版
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/init/data/friend/product/one", method = RequestMethod.POST)
    Result initProcuctFriend(@RequestParam("userId") Long userId);

    /**
     * 功能描述: 高校版推荐计算推荐用户
     *
     * @param: userId 用户id
     * @return: com.zynn.common.pojo.result.Result
     * @author: Administrator
     * @date: 2018/9/17 16:41
     **/
    @RequestMapping(value = "/init/data/version/school/friend", method = RequestMethod.POST)
    Result initFriendVersionSchool(@RequestParam("userId") Long userId, @RequestParam(value = "beLikedUserId", required = false) Long beLikedUserId);


    /**
     * 个人资料信息匹配用户推荐
     *
     * @param inviteUserId
     * @param beInvitedUserId
     * @return
     */
    @RequestMapping(value = "/init/data/friend/profile", method = RequestMethod.POST)
    Result initFriendVersionProfile(@RequestParam("inviteUserId") Long inviteUserId, @RequestParam("beInvitedUserId") Long beInvitedUserId);


    /**
     * 第三版推荐
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/init/data/friend/v3", method = RequestMethod.POST)
    Result initFriendV3(@RequestParam("userId") Long userId);

}
